﻿@model List<Galaxy.Entities.User>
@section styles{
    <link href="~/lib/AdminLTE/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" asp-append-version="true" />
    <style type="text/css">
        .trchange {
            background-color: #08C;
            color: white;
        }
    </style>
}
@section scripts {
    <script src="~/view-resources/Views/Users/Index.js" asp-append-version="true"></script>
}
<div class="content-wrapper" id="mainDiv" style="min-height: 935px;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户管理
            <small>列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href='@Url.Content("~/Home/Index")'><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">系统管理</a></li>
            <li class="active">用户管理</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="user_table_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-3">
                                    <div class="dataTables_length" id="user_table_length">
                                        <label>
                                            <select name="user_table_length" id="user_page" aria-controls="user_table" class="form-control input-sm">
                                                <option value="10">10</option>
                                                <option value="20">20</option>
                                                <option value="50">50</option>
                                                <option value="-1">全部</option>
                                            </select> 记录/页
                                        </label>
                                    </div>
                                </div>
                                <div class="col-sm-9">
                                    <div class="dataTables_filter" id="searchDiv">
                                        <input id="search_name" placeholder="请输入姓名" name="name" class="form-control" type="search" likeoption="true">
                                        <input id="search_username" placeholder="请输入登录名" name="loginName" class="form-control" type="search" likeoption="true">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-primary" data-btn-type="search">查询</button>
                                            <button type="button" class="btn btn-default" data-btn-type="reset">重置</button>
                                        </div>
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-default" data-btn-type="add">新增</button>
                                            <button type="button" class="btn btn-default" data-btn-type="edit">编辑</button>
                                            <button type="button" class="btn btn-default" data-btn-type="delete">删除</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="user_table" class="table table-border table-hover dataTable no-footer" style="width: 100%;" role="grid" aria-describedby="user_table_info">
                                        <thead>
                                            <tr role="row">
                                                <th class="text-center sorting_disabled" rowspan="1" colspan="1" aria-label="序号">序号</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="user_table" rowspan="1" colspan="1" aria-label="姓名: activate to sort column ascending">姓名</th>
                                                <th class="sorting_disabled text-center" rowspan="1" colspan="1" aria-label="所在部门">所在部门</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="user_table" rowspan="1" colspan="1" aria-label="性别: activate to sort column ascending">性别</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="user_table" rowspan="1" colspan="1" aria-label="出生年月: activate to sort column ascending">出生年月</th>
                                                <th class="text-center sorting" tabindex="0" aria-controls="user_table" rowspan="1" colspan="1" aria-label="登录名: activate to sort column ascending">登录名</th>
                                                <th class="sorting_disabled text-center" rowspan="1" colspan="1" aria-label="邮箱">邮箱</th>
                                                <th class="text-center sorting_disabled" rowspan="1" colspan="1" aria-label="手机">手机</th>
                                                <th class="text-center sorting_disabled" rowspan="1" colspan="1" aria-label="QQ">QQ</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @for (int i = 0; i < Model.Count(); i++)
                                            {
                                                <tr id="@Model[i].Id" role="row" class='@(i % 2 == 0 ? "odd" : "even")'>
                                                    <td class="text-center sorting_1">@((ViewBag.PageIndex - 1) * ViewBag.PageSize + i + 1)</td>
                                                    <td class="text-left">@Model[i].Name</td>
                                                    <th class="text-center">@Model[i].DepartmentId</th>
                                                    <td class="text-left">@(Model[i].Gender == 0 ? "男" : "女")</td>
                                                    <td class="text-center">@Model[i].Birthday.ToString("yyyy-MM-dd")</td>
                                                    <td class="text-center">@Model[i].UserName</td>
                                                    <td class="text-center">@Model[i].Email</td>
                                                    <td class="text-center">@Model[i].Phone</td>
                                                    <td class="text-center">@Model[i].QQ</td>
                                                </tr>
                                            }
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            @Html.Raw(ViewBag.Page)
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<!--隐藏域-->
<input type="hidden" id="pageIndex" value="@ViewBag.PageIndex" />
<input type="hidden" id="pageSize" value="@ViewBag.PageSize" />
<input type="hidden" id="key" value="@ViewBag.Key" />